<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        function Iterator(obj){
            obj[Symbol.iterator] = function(){
                let val = Object.values(obj);
                let idx = -1;
                return{
                    next:function(){
                        idx++;
                        if(idx<val.length){
                            return{done:false,value:val[idx]};
                        }
                        else{
                            return{done:true,value:val[idx]}
                        }
                    }
                }
            }
        }
        let obj1 = {
            name:"崽崽",
            age:23,
            gender:"女"
        };
        Iterator(obj1);
        let it = obj1[Symbol.iterator]();
        console.log(it.next()); 
        console.log(it.next()); 
        console.log(it.next()); 
        console.log(it.next()); 
    </script>
</body>
</html>